/**
 * 临时数据模型
 *
 * Created by liuxuechao on 2022/07/31.
 */
const mongoose = require('mongoose');
const schemaDefinition = require('./schema/ephemeral-data');
const schemaInstance = mongoose.Schema(schemaDefinition);
schemaInstance.index({ createdDate: 1 }, { expireAfterSeconds: 300 }); // 5min
const modelInstance = mongoose.model('ephemeralData', schemaInstance);

/**
 * Export model definition object.
 */
module.exports = modelInstance;
